<?php

namespace app\admin\controller;

use app\index\controller\Basecontroller;
use think\Db;

class Datastat extends Basecontroller
{

  function getClass()
  {
    $res = Db::table('gjc_classify')
      ->field('c.c_name, c.cid , count(c.cid) as count')
      ->alias('c')
      ->join('gjc_goods g', 'g.cid = c.cid')
      ->where('c.cid != 1')
      ->group('c.cid')
      ->select();

    return res(1000, 'ok', $res);
  }
  function getMenu()
  {
    $res = db('menu')->select();
    return res(1000, 'ok', $res);
  }
}
